﻿using PeiYue.IRepository.Base;
using PeiYue.IServices.Store;
using PeiYue.Model.Models.Store;
using PeiYue.Services.BASE;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace PeiYue.Services.Store
{
    public class DeliveryLogServices : BaseServices<DeliveryRecordLogDao>, IDeliveryLogServices
    {
        IBaseRepository<DeliveryRecordLogDao> _dal;
        public DeliveryLogServices(IBaseRepository<DeliveryRecordLogDao> dal)
        {
            this._dal = dal;
            base.BaseDal = dal;
        }
        public async Task<int> UpdateLog(DeliveryRecordLogDao dao)
        {
            return await _dal.ExecuteCommand("update DeliveryRecordLog set Status=1,UpdateTime=getdate(),UpdateUser=@CreateUser where  BarCode=@BarCode and OrderDetailId=@OrderDetailId and CreateUser=@CreateUser and Status=0", new { UpdateUser= dao.CreateUser, dao.OrderDetailId ,dao.CreateUser,dao.BarCode});
        }
    }
}
